<?php require APP_ROOT.'public/top.php';
$edit=pg('edit');
$level=pg('level');
?>

<div data-v-7f4a8000="" class="g-bd f-cb">
  <?php require APP_ROOT.'public/left.php';?>
  <div class="g-mn">
    <div class="g-ct">
      <form id="form-report" class="c-form" action="">
           <!--
        <div class="w-tab" style="margin:10px 0 20px;position:relative">

<h2 class="u-tt">&nbsp;&nbsp;</h2>
 
          <ul>
            <li class="<?php if($level=='')echo 'z-crt';?>"><a href="index.php?m=member&a=data">总报表</a> </li>
            <li class="<?php if($level=='plan')echo 'z-crt';?>"><a href="index.php?m=member&a=data&level=plan">推广计划</a> </li>
            <li class="<?php if($level=='group')echo 'z-crt';?>"><a href="index.php?m=member&a=data&level=group">推广组</a> </li>
            <li class="<?php if($level=='originality')echo 'z-crt';?>"><a href="index.php?m=member&a=data&level=originality">推广创意</a></li>
          </ul>


          <div class="f-fr" style="position:absolute;right:0;top:-10px"> 时间范围:
            <label id="select-date" class="w-date f-fs12" style="width:400px;margin-top:0;">
              <input class="w-date-button w-date-hidden-start laydate-input" value="<?php echo $start_date;?>" name="start_date" type="text" onclick="laydate({istime: true, format: 'YYYY-MM-DD'})" style="float:left;">
              <span style="float:left;">&nbsp;至:&nbsp;</span><input class="w-date-button w-date-hidden-end laydate-input" value="<?php echo $end_date;?>" name="end_date" type="text" onclick="laydate({istime: true, format: 'YYYY-MM-DD'})" style="float:left;">
              </label>
            &nbsp;&nbsp;&nbsp;&nbsp; </div>
        </div>
-->
        <!--
        <div class="report-slt">
          <dl class="f-cb f-fs14">
            <dt class="f-fl" style="margin-right:10px">显示方式 <i class="f-efonts f-fs14 j-tips" data-tips="1.	分日: 显示分日的数据<br/>2.	分小时: 显示分小时的数据,至多显示最近7天的数据"></i>: </dt>
            <dd class="f-fl"> <a href="javascript:;" class="js-report-type active" data-value="2">分日</a>&nbsp;&nbsp; <a href="javascript:;" class="js-report-type " data-value="3">分小时</a>
              <input type="hidden" name="display_type" id="display_type" value="2">
              <input type="hidden" name="day_check" value="self">
              <a id="submit" class="f-dn" href="javascript:void(0)"></a>&nbsp;&nbsp;&nbsp;&nbsp; </dd>
          </dl>
        </div>
        -->
        <input type="hidden" name="_csrf" value="QXl2QjNNR0QkMUE2WBh0EB4hQwpEPDF2IwM.NWtgLhckHxgKBicfEg==">
      </form>
      <p style="border-bottom:1px solid #e9e9e9"><em class="f-fs14">趋势图</em></p>
      <div class="chart-container">
        <div class="f-cb">
          <div class="f-fr" style="margin-top:5px; margin-bottom:10px">
            <label id="first-index" class="w-select" style="width:160px"> <i class="w-select-icon f-efonts">󰅰</i> <a href="javascript:void(0)" class="w-select-button">CPC</a>
              <input type="hidden" name="media_type" id="media_type" value="total_cost">
              <!---
              <span class="w-select-lists" style="overflow-y: scroll; height: 200px;"> <a value="views" href="javascript:void(0)">展示次数</a> <a value="clicks" href="javascript:void(0)">点击次数</a> <a value="click_percent" href="javascript:void(0)">点击率</a> <a value="thousand_views" href="javascript:void(0)">千次展现成本</a> <a value="click_cost" href="javascript:void(0)">平均点击成本</a> <a value="total_cost" href="javascript:void(0)">总费用</a> <a value="unique_views" href="javascript:void(0)">展现独立访客</a> <a value="unique_views_rate" href="javascript:void(0)">平均展现频次</a> <a value="unique_clicks" href="javascript:void(0)">点击独立访客</a> <a value="unique_clicks_cost" href="javascript:void(0)">平均独立访客点击成本</a> <a value="converts" href="javascript:void(0)">转化数</a> <a value="convert_rate" href="javascript:void(0)">转化率</a> <a value="convert_cost" href="javascript:void(0)">转化成本</a> <a value="ocpc_down_active" href="javascript:void(0)">激活数</a> <a value="ocpc_down_active_rate" href="javascript:void(0)">激活率</a> <a value="ocpc_down_active_cost" href="javascript:void(0)">激活成本</a> <a value="ocpc_down_reg" href="javascript:void(0)">注册数</a> <a value="ocpc_down_reg_rate" href="javascript:void(0)">注册率</a> <a value="ocpc_down_reg_cost" href="javascript:void(0)">注册成本</a> <a value="ocpc_down_retention" href="javascript:void(0)">次留数</a> <a value="ocpc_down_retention_rate" href="javascript:void(0)">次留率</a> <a value="ocpc_down_retention_cost" href="javascript:void(0)">次留成本</a> <a value="ocpc_down_pay" href="javascript:void(0)">付费数</a> <a value="ocpc_down_pay_rate" href="javascript:void(0)">付费率</a> <a value="ocpc_down_pay_cost" href="javascript:void(0)">付费成本</a> <a value="ocpc_down_quality" href="javascript:void(0)">质量度</a> <a value="ocpc_down_quality_rate" href="javascript:void(0)">质量度率</a> <a value="ocpc_down_quality_cost" href="javascript:void(0)">质量度成本</a> <a value="current_increased" href="javascript:void(0)">激活数(平台)</a> <a value="current_increased_rate" href="javascript:void(0)">激活率(平台)</a> <a value="current_increased_cost" href="javascript:void(0)">激活成本(平台)</a> </span>
              -->
              </label>
            <label id="second-index" class="w-select" style="width:160px"> <i class="w-select-icon f-efonts">󰅰</i> <a href="javascript:void(0)" class="w-select-button">CPM</a>
              <input type="hidden" name="media_type" id="media_type" value="click_percent">
              <!---
              <span class="w-select-lists" style="overflow-y: scroll; height: 200px;"> <a value="views" href="javascript:void(0)">展示次数</a> <a value="clicks" href="javascript:void(0)">点击次数</a> <a value="click_percent" href="javascript:void(0)">点击率</a> <a value="thousand_views" href="javascript:void(0)">千次展现成本</a> <a value="click_cost" href="javascript:void(0)">平均点击成本</a> <a value="total_cost" href="javascript:void(0)">总费用</a> <a value="unique_views" href="javascript:void(0)">展现独立访客</a> <a value="unique_views_rate" href="javascript:void(0)">平均展现频次</a> <a value="unique_clicks" href="javascript:void(0)">点击独立访客</a> <a value="unique_clicks_cost" href="javascript:void(0)">平均独立访客点击成本</a> <a value="converts" href="javascript:void(0)">转化数</a> <a value="convert_rate" href="javascript:void(0)">转化率</a> <a value="convert_cost" href="javascript:void(0)">转化成本</a> <a value="ocpc_down_active" href="javascript:void(0)">激活数</a> <a value="ocpc_down_active_rate" href="javascript:void(0)">激活率</a> <a value="ocpc_down_active_cost" href="javascript:void(0)">激活成本</a> <a value="ocpc_down_reg" href="javascript:void(0)">注册数</a> <a value="ocpc_down_reg_rate" href="javascript:void(0)">注册率</a> <a value="ocpc_down_reg_cost" href="javascript:void(0)">注册成本</a> <a value="ocpc_down_retention" href="javascript:void(0)">次留数</a> <a value="ocpc_down_retention_rate" href="javascript:void(0)">次留率</a> <a value="ocpc_down_retention_cost" href="javascript:void(0)">次留成本</a> <a value="ocpc_down_pay" href="javascript:void(0)">付费数</a> <a value="ocpc_down_pay_rate" href="javascript:void(0)">付费率</a> <a value="ocpc_down_pay_cost" href="javascript:void(0)">付费成本</a> <a value="ocpc_down_quality" href="javascript:void(0)">质量度</a> <a value="ocpc_down_quality_rate" href="javascript:void(0)">质量度率</a> <a value="ocpc_down_quality_cost" href="javascript:void(0)">质量度成本</a> <a value="current_increased" href="javascript:void(0)">激活数(平台)</a> <a value="current_increased_rate" href="javascript:void(0)">激活率(平台)</a> <a value="current_increased_cost" href="javascript:void(0)">激活成本(平台)</a> </span>
              -->
              </label>
            <!---
            <span class="legend" style="margin-left:30px"> <span class="f-efonts f-fs14" style="color:#85c1e9"></span> <span class="first-index-text f-fs14" style="vertical-align:middle">总费用</span>&nbsp;&nbsp;&nbsp;&nbsp; <span class="f-efonts f-fs14" style="color:#d87b81"></span> <span class="second-index-text f-fs14" style="vertical-align:middle">点击率</span></span></div>
			-->
</div>
        
            <script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript" src="js/echarts.min.js"></script>
    <style>
        #someline {
            width: 100%;
            height: 500px; z-index:1000;
        }
    </style> 	
    <script>
      $(document).ready(function(){
        var chart = document.getElementById("someline");
        var echart = echarts.init(chart);
        option = {
            title: {
                text: ''
            },
            tooltip: {
                trigger: 'axis'
            },
            legend: {
                data: ['曝光量','点击量','消费金额']
            },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            },
            toolbox: {
                feature: {
                    saveAsImage: {}
                }
            },
            xAxis: {
                type: 'category',
                boundaryGap: false,
                data: ['<?php echo implode('\',\'',get_week());?>']
            },
            yAxis: {
                type: 'value'
            },
            series: [
                {
                    name: '曝光量',
                    type: 'line',
                    stack: '总量',
                    data: [<?php echo implode(',',bgnumber($member_id,'zxcs'));?>]
                },
				{
                    name: '点击量',
                    type: 'line',
                    stack: '总量',
                    data: [<?php echo implode(',',bgnumber($member_id,'djcs'));?>]
                },
                {
                    name: '消费金额',
                    type: 'line',
                    stack: '总量',
                    data: [<?php echo implode(',',consumption_price($member_id));?>]
                }
            ]
        };



        echart.setOption(option);
      });
    </script>
<div id="someline"></div>



        <div id="chart-loading" style="display: none;"></div>
      </div>
      
      <table data-v-6f5551eb="" class="grid" style="margin-top:50px;">
                  <thead data-v-e0b3f32e="" data-v-6f5551eb="" class="grid-head">
                    <tr data-v-e0b3f32e="">
                      <th data-v-e0b3f32e="" class=""><em data-v-e0b3f32e="" class="sort" style="display: none;"></em> 时间 </th>
                      <th data-v-e0b3f32e="" class=""><em data-v-e0b3f32e="" class="sort" style="display: none;"></em> 曝光量 </th>
                      <th data-v-e0b3f32e="" class=""><em data-v-e0b3f32e="" class="sort" style="display: none;"></em> 点击量 </th>
                      <th data-v-e0b3f32e="" class=""><em data-v-e0b3f32e="" class="sort" style="display: none;"></em> 消费金额 </th>
                    </tr>
                  </thead>
                  <tbody data-v-6f5551eb="" class="grid-body">
                  <?php
                  
                    $get_week=get_week();
                    $start_date=M('account')->where(array('member_id'=>$member_id))->order('account_id asc')->getfield('date');
                    $start_date = strtotime(date('Y-m-d',$start_date));
                  
                    $end_date=M('account')->where(array('member_id'=>$member_id))->order('account_id desc')->getfield('date');
                 
                    while ($end_date>=$start_date){
                        $date[]=strtotime(date('Y-m-d',$end_date))+60*60*24;
                        $end_date= strtotime('-1 day',$end_date);
                      	
                    }
                   
                    foreach($date as $k=>$v)
                    {
                        $acc=M('account')->where('member_id='.$member_id.' and amount_type=2 and date<'.$v.' and date>'.($v-60*60*24))->sum('amount');
                      $acc=sprintf("%.2f",$acc==''?0:$acc);
                        $amount[]= M()->_sql().'<br>';
                      
                      $zxcs=M('datedata')->where('member_id='.$member_id.' and date<'.$v.' and date>'.($v-60*60*24))->getfield('zxcs');
		//$amount[]=M()->_sql();
        $zxcs=$zxcs==''?0:$zxcs;
                      
                      
                      $djcs=M('datedata')->where('member_id='.$member_id.' and date<'.$v.' and date>'.($v-60*60*24))->getfield('djcs');
		//$amount[]=M()->_sql();
        $djcs=$djcs==''?0:$djcs;
                      
						?>
                    <tr class="">
                      <td class=""><?php echo cover_time($v-60*60*24,'Y-m-d H:i:s');?></td>
                      <td class=""> <?php echo $zxcs;?> </td>
                      <td class=""> <?php echo $djcs;?> </td>
                      <td class=""> ￥<?php echo $acc;?> </td>
                    </tr>
                    <?php }?>
                    
                  </tbody>
                </table>
    </div>
  </div>
</div>
</div>
</div>
<?php require APP_ROOT.'public/bottom.php';?>
